function commonFoot(name='home'){
    let div= document.createElement('div')

    div.className='foot'
    
    div.innerHTML=`
        <div class="foot-icon">
          <a class="${name==='home'? 'active':''}" href="./home.html">
            <span class="iconfont icon-home"></span>
            <span class="foot-tips">首页</span>
          </a>
          <a class="${name==='run'? 'active':''}" href="./run.html">
            <span class="iconfont icon-run"></span>
            <span class="foot-tips">运动</span>
          </a>
          <a class="${name==='attention'? 'active':''}" href="./attention.html">
            <span class="iconfont icon-circle"></span>
            <span class="foot-tips">圈子</span>
          </a>
          <a class="${name==='mine'? 'active':''}" href="./mine.html">
            <span class="iconfont icon-aboutme"></span>
            <span class="foot-tips">我的</span>
          </a>
        </div>
    `
    document.body.append(div)
}

function ringCommonHeader(name='attention'){
  let div=document.createElement('div')
  div.className='ring-header'
  div.innerHTML=`
    <div class="atn-head">
      <ul class="attention-head">
        <li><a class="${name==='attention'? 'active':''}" href="./attention.html">关注</a></li>
        <li><a class="${name==='nearby'? 'active':''}" href="./nearby.html">附近</a></li>
        <li><a class="${name==='collection'? 'active':''}" href="./collection.html">收藏</a></li>
        <li><a>个人动态</a></li>
      </ul>
      <a class="head-add" href="./dynamic.html">添加+</a>
    </div>
  `
  document.body.prepend(div)
}

function runCommonHeader(name='run'){
  let div=document.createElement('div')
  div.className='run-position'
  div.innerHTML=`
    <ul class="run-list">
      <li><a class="${name==='run'?'active':''}" href="./run.html">跑步</a></li>
      <li><a class="${name==='riding'?'active':''}" href="./riding.html">骑行</a></li>
      <li><a class="${name==='short-part'?'active':''}" href="./short-part.html">精彩片段</a></li>
    </ul>
  `
  document.body.prepend(div)
}

module.exports={
  commonFoot,
  ringCommonHeader,
  runCommonHeader
}